vcRealProperty

A property that holds a Real value.

See in: Overview

Module: vcCore

Parent: vcProperty

Children: vcDistributionProperty

Referenced by: vcSingleDofLinkJoint.PassiveValueSource

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
MagnitudeRealRWGets or sets the magnitude of a property's value.
QuantityvcQuantityRWGets or sets the quantity of a property's value.
TypevcPropertyTypeRGets the property type.
UnitvcUnitRGets the unit of a property's value.
ValueRealRWGets or sets the property's value.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
waitForobjectReal OR None value,
Optional Keyword[waitTrigger = Boolean]
Blocks script execution until vcProperty.Value is equal to the "value".
See more
This function returns an awaitable task. It must be awaited.

Parameters:
value (object): Value that is used for comparison. When the value is equal to vcProperty.Value, the task completes.
Optional: waitTrigger (boolean): False by default. When waitTrigger is True, the task will wait for the value to change first, before comparing it against "value". Otherwise, the comparison is done immediately and when the values match, the task will complete without blocking the script.

Returns:
Awaitable[List]: The task instance. When awaited, returns a list of event arguments that the event has been triggered with.
waitForNotobjectReal OR None value,
Optional Keyword[waitTrigger = Boolean]
Blocks script execution until vcProperty.Value is not equal to the "value".
See more
This function returns an awaitable task. It must be awaited.

Parameters:
value (object): Value that is used for comparison. When the value is not equal to vcProperty.Value, the task completes.
Optional: waitTrigger (boolean): False by default. When waitTrigger is True, the task will wait for the value to change first, before comparing it against "value". Otherwise, the comparison is done immediately and when the values do not match, the task will complete without blocking the script.

Returns:
Awaitable[List]: The task instance. When awaited, returns a list of event arguments that the event has been triggered with.

Example: Real Property Limits

"""This example shows how to set properties with limits and setting their values"""

import vcCore as vc

comp = vc.getComponent()
real_prop = comp.Properties["Test_Real"]
real_prop.MinValue = 10.0
real_prop.MaxValue = 100.0
real_prop.Value = 50.0
print (real_prop.MinValue, real_prop.MaxValue, real_prop.Value)
#prints 10.0 100.0 50.0

Example: Set Quantity and Unit for Property

""" This example shows how to set the quantity and unit to vcRealProperty. """

import vcCore as vc

comp = vc.getComponent()
prop = comp.Properties["ProcessTime"]
quantity = vc.vcUnitManager.findQuantity("Time")
prop.Quantity = quantity
unit_group = vc.vcUnitManager.findUnitGroup("Time")
unit = next(unit for unit in unit_group.Units if unit.Name == "hours")
prop.Magnitude = unit.Factor